package com.tbit.uqbike.webmanager.dao.capital;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.tbit.config.datasource.DataSource;
import com.tbit.uqbike.object.pojo.RideFeeLog;
import com.tbit.uqbike.object.pojo.dto.RideFeeLogStatisticsDTO;
import com.tbit.uqbike.object.pojo.vo.RideFeeLogTotalVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author yee_
 * @date 2023/11/21
 */
@DS(DataSource.CAPITAL)
public interface RideFeeLogDao {
    /**
     * 查询订单收费记录
     *
     * @param brandId .
     * @param accountId .
     * @param startTime .
     * @param endTime .
     * @param type .
     * @return .
     */
    List<RideFeeLog> queryRideFeeLogPage(@Param("brandId") Integer brandId, @Param("accountId") Integer accountId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("type") Integer type);

    /**
     * 查询订单收费记录
     *
     * @param brandId .
     * @param accountIdList .
     * @param startTime .
     * @param endTime .
     * @param type .
     * @return .
     */
    List<RideFeeLog> queryRideFeeLogPageByAccountIdList(@Param("brandId") Integer brandId, @Param("accountIdList") List<Integer> accountIdList, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("type") Integer type);

    RideFeeLogStatisticsDTO selectRideFeeLogStatistics(@Param("brandId") Integer brandId, @Param("accountIdList") List<Integer> accountIdList, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("type") Integer type);

    List<RideFeeLog> selectLastRecord(@Param("brandId") Integer brandId, @Param("accountIdList") List<Integer> accountIdList, @Param("type") Integer type);


    /**
     * 订单收费记录汇总
     *
     * @param brandId .
     * @param accountId .
     * @param startTime .
     * @param endTime .
     * @param type .
     * @return .
     */
    RideFeeLogTotalVO queryRideFeeLogTotal(@Param("brandId") Integer brandId, @Param("accountId") Integer accountId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("type") Integer type);

    /**
     * 订单收费记录数量查询
     *
     * @param brandId .
     * @param accountId .
     * @param startTime .
     * @param endTime .
     * @param type .
     * @return .
     */
    int queryRideFeeLogCount(@Param("brandId") Integer brandId, @Param("accountId") Integer accountId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("type") Integer type);
}
